<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->

<?php

    $id = $_GET['id'];
    include "Customer.php";
    include "CustomerDao.php";
    include "Datasource.php";

    $tempCustomer = new Customer();
    $customerDao = new CustomerDao();
    $conn = new Datasource("localhost","theanykey","root","");

    $tempCustomer = $customerDao->getObject($conn, $id)

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body onload="postToForm();">



    </body>
    <script type="text/javascript">
        function postToForm()
        {
            w = window.opener;
            w.document.getElementById("id").value = "<?php echo $tempCustomer->getCustomerId(); ?>";
            w.document.getElementById("first").value = "<?php echo $tempCustomer->getFirstName(); ?>";
            w.document.getElementById("last").value = "<?php echo $tempCustomer->getLastName(); ?>";
            w.document.getElementById("addr").value = "<?php echo $tempCustomer->getAddress(); ?>";
            w.document.getElementById("city").value = "<?php echo $tempCustomer->getCity(); ?>";
            w.document.getElementById("state").value = "<?php echo $tempCustomer->getState(); ?>";
            w.document.getElementById("zip").value = "<?php echo $tempCustomer->getZip(); ?>";
            w.document.getElementById("email").value = "<?php echo $tempCustomer->getEmail(); ?>";
            w.document.getElementById("phone1").value = "<?php echo $tempCustomer->getPhoneNumber1(); ?>";
            w.document.getElementById("phone2").value = "<?php echo $tempCustomer->getPhoneNumber2(); ?>";
            w.document.getElementById("phone3").value = "<?php echo $tempCustomer->getPhoneNumber3(); ?>";

            window.close();

        }

    </script>
</html>
